<template>
    <div class="disflex jusbet red fs14 pr28 postionab bottom70 w100p">
        <el-pagination
                background
                layout="prev, pager, next"
                :prev-text="'<上一页'"
                :next-text="'下一页>'"
                :page-count="Number(pageCount)"
                :current-page="currentPage"
                @current-change="currentChange"
                pager-count="5">
        </el-pagination>
        <span class="fs14 c333 pl10 pr10 lh35 beee curpointer hoverred" @click="currentChange(pageCount)">跳转至尾页></span>
    </div>
</template>

<script>
    export default {
        name: "PageDevice",
        props:['pageCount'],
        data(){
            return{
                currentPage:1
            }
        },
        watch:{
            '$route'(to,from){
                if(to.name == 'details'){
                    this.currentPage = 1;
                }
            }
        },
        methods:{
            currentChange(page){
                this.currentPage = page;
                this.$emit('currentChange',page);
            }
        }
    }
</script>

<style>
    .red .el-pagination{
        padding: 0 0 0  .2rem;
    }
    .red .el-pagination.is-background .el-pager li:not(.disabled).active{
        background: #bf000e;
    }
    .red .el-pagination.is-background .el-pager li{
        min-width: auto;
        width: .35rem;
        height: .35rem;
        line-height: .35rem;
        margin: 0;
        border-radius: 1px;
        font-size: .14rem;
        padding: 0;
        background: none;
        border: 1px solid #eee;
        border-right: 0;
    }
    .red .el-pagination button{
        min-width: auto;
        width: .75rem;
        line-height: .35rem;
        height: .35rem;
        font-size: .14rem;
    }
    .red .el-pagination.is-background .btn-next,.red .el-pagination.is-background .btn-prev{
        margin: 0;
        background: none;
        border: 1px solid #eee;
    }
    div.el-pagination button, .el-pagination span:not([class*=suffix]){
        height: .35rem;
        line-height: .35rem;
        font-size: .12rem;
    }
</style>


















